

import datetime
import stockanalyzer as stock
import stockcalc as calc




stock.addStock('QIHU')
stock.addStock('KONG')
stock.addStock('WUBA')

stock.update()



startDate = datetime.date(2013, 9, 20)
stopDate = datetime.date(2013, 11, 12)

#stock.getLocalHistorical('QIHU', start = str(startDate), stop = str(stopDate))
#print stock.getLocalHistorical('QIHU', start = startDate)


#print calc.get_mea('QIHU', 12, startDate, stopDate)

'''
dates, macd = calc.stockMacd('QIHU', stop = stopDate)
for date, data in zip(dates, macd):
    print date, data
'''

dates, macdema = calc.stockMacd('QIHU', stop = stopDate)
for date, data in zip(dates, macdema):
    print date, data

#for date in sorted(r[0].iterkeys()):
    #print date, r[date]


#print stock.getLocalHistorical('QIHU', datetime.date.today())

#print calc.get_mea('QIHU', 12)
#print calc.get_mea('QIHU', 12, datetime.date(2013, 10, 1), datetime.date(2013, 11, 1))

